I am trying to get the API working on a fresh install, however I can't get around the following error when doing a login:
I did find a reference on the net to the undefined method 'each_char' with a workaround adding this to the cli_libs/argument_processor.rb:
Then the error changes to:
after looking at that line
and trying a change to
the following error is thrown:
I'm wondering if anyone else has any ideas, because it doesn't seem like I can work around the problem. Wondering if its a version issue, etc?
Version Info:
centos 5.4
zabbix 1.8.1
ruby 1.8.5
gem 1.3.5
I have also tried the zabbixapi.rb (updating server, username, password)
and the first few commands seem to run fine, but then it errors on:
Code:
login http://127.0.0.1/zabbix zabcon password
./cli_libs/argument_processor.rb:88:in `safe_split': undefined method `each_char' for "http://127.0.0.1/zabbix admin zabbix":String (NoMethodError)...
Code:
require 'jcode'
./zabbixapi.rb:143:in `initialize': undefined method `+' for nil:NilClass (NoMethodError)...
Code:
@url=URI.parse(url+'/api_jsonrpc.php')
Code:
@url=URI.parse('http://127.0.0.1/zabbix/api_jsonrpc.php')
Login error, incorrect login information
Server: User: password:
./cli_libs/printer.rb:291:in `print': undefined method `[]' for false:FalseClass (NoMethodError)...
Server: User: password:
./cli_libs/printer.rb:291:in `print': undefined method `[]' for false:FalseClass (NoMethodError)...
Version Info:
centos 5.4
zabbix 1.8.1
ruby 1.8.5
gem 1.3.5
I have also tried the zabbixapi.rb (updating server, username, password)
and the first few commands seem to run fine, but then it errors on:
Getting by username, admin, number should be seen
zabbixapi.rb:250:in `do_request': ZbxAPI_GeneralError
from zabbixapi.rb:310:in `do_request'
from zabbixapi.rb:360:in `getid'
from zabbixapi.rb:837
zabbixapi.rb:250:in `do_request': ZbxAPI_GeneralError
from zabbixapi.rb:310:in `do_request'
from zabbixapi.rb:360:in `getid'
from zabbixapi.rb:837
Comment